<template>
     <el-cascader
     size="small"
    :value="value"
    :options="options"
    @change="handleChange"
    :props="props"
    clearable
    >
    </el-cascader>
</template>
<script>
import { list } from "../api/building";
export default {
  name: "CasCader",
  data() {
      return {
        query: {
            pid:'',
        },
        value: [],
        options: [],
        props:{
          value:'id',
        label: "name"
        }
      };
    },
    created(){
        this.getList();
    },
    methods: {
       async getList(){
        let { data:{list:listdata} } = await list(this.query)
        console.log(listdata);
        this.options = listdata;
        
        
       },
      handleChange(value) {
        this.value = value;
        this.$emit("handleChange",value)
      }
    }
}
</script>
<style lang="less" scoped>

</style>